function deboundce(fun, duration = 100) {
  let timer = null;
  function _executar(...args) {
    timer = setTimeout(() => {
      fun.apply(this, ...args);
    }, duration);
  }
  _executar.cancel = () => {
    console.log('取消了');
    clearTimeout(timer);
  };
  return _executar;
}

export default deboundce;
